package cn.ym.mall.service;

import cn.ym.mall.entity.Comment;
import cn.ym.mall.vo.Page;

import java.sql.SQLException;
import java.util.List;

/**
 * 评论业务层
 */
public interface CommentService {
    /**
     * 通过商品查询评论
     * @param gid
     * @return
     */
    public Page<Comment> getCommentByGid(Integer gid, Integer pageNo, Integer pageSize) throws SQLException;

    /**
     * 通过用户查询评论
     * @param uid
     * @return
     */
    public Page<Comment> getCommentByUid(Integer uid,Integer pageNo,Integer pageSize)throws SQLException;

    /**
     * 添加评论
     * @param comment
     * @return
     */
    public boolean add(Comment comment) throws SQLException;

    /**
     * 删除评论
     * @param cid
     * @return
     */
    public boolean delete(Integer cid) throws SQLException;

    /**
     * 删除商品所有评论
     * @param gid
     * @return
     * @throws SQLException
     */
    public boolean deleteByGid(Integer gid) throws SQLException;
}
